This invention generally relates to data processing systems and more specifically to a central processor that is adapted for processing data in the form of extended sequences of characters.
A conventional central processor for a data processing system has a characteristic instruction set that includes program control instructions and arithmetic-logic instructions. Branch instructions and jump instructions are examples of program control instructions. Instructions for performing addition, substraction, logical AND, logical OR, and similar functions are examples of arithmetic-logic functions.
When a central processor executes an arithmetic-logic instruction, it sets or clears various flags that indicate certain characteristics of the resulting arithmetic-logic operation. In the PDP11 central processor described in U.S. Pat. No. 3,614,740 and 3,614,741 and the Microcomputer Handbook, these include a Z flag, an N flag, a V flag and a C flag. The Z flag is set if an arithmetic-logic result is zero; the N flag is set if the result is negative; the C flag is set if the operation results in a carry from the most significant bit or if a ONE is shifted from the most or least significant bits; and the V flag is set if the operation results in an arithmetic overflow. These flags are useful in ascertaining certain characteristics of individual arithmetic-logic operations.
A conventional central processor also responds to a particular one of its arithmetic-logic instructions by processing information in units of fixed length. For example, the PDP11 central processor described in the foregoing patents and publication, processes either data "words" that are constituted by two eight-bit "bytes" or single data bytes. Although this format of data organized into fixed-length bytes and words normally is adequate for arithmetic-logic operations, there are many applications arising for data processing systems which require more sophisticated processing of data. Applications for computer-assisted editing of programs by programmers or of textual material by publishers and by office personnel who utilize word processing equipment are examples. In these applications the data comprises sequences of many characters. Generally each character is stored at one byte location in a memory and all the characters are stored in a sequence of consecutive byte locations. A sequence of characters is called a "character string".
As conventional PDP11 and similar central processors are limited to processing one word, or some limited number of words, during each instruction, fairly complex subroutines must be written with the available intructions in order to process character strings. Indeed a number of character string functions have been implemented using subroutines. Two general types of subroutines are of interest with respect to this invention. One type includes comparison subroutines for determining the whether two character strings are identical. The other type includes subroutines which determine whether a character string includes a specific character or group of characters.
The necessity for implementing these functions with subroutines reduces the rate at which the character strings can be processed and also complicates the programs. Any complication in programming also leads to errors which then must be found and corrected.
Therefore there is an object of this invention to simplify the analysis of a character string in a data processing system.
Another object of this invention is to provide a central processor that includes specific machine instructions for processing character strings.
Still another object of this invention is to provide a machine instruction for a central processor that enables the processor to analyze a character string to determine whether it conforms to some predetermined characteristic.
Yet another object of this invention is to provide a machine instruction for a central processor that enables the central processor to compare two distinct character strings to determine whether they are identical.